package com.rapida.pet.core;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BootReceiver extends BroadcastReceiver {
	private String ACTION_BOOT = "android.intent.action.BOOT_COMPLETED";
	private String ACTION_RESTART = "service.action.RESTART_SERVICE";

	@Override
	public void onReceive(Context context, Intent intent) {
		if (ACTION_BOOT.equals(intent.getAction()) || ACTION_RESTART.equals(intent.getAction())){
			startService(context);
		}
	}

	private void startService(Context context){
		Intent intent = new Intent(context, PetService.class);
		context.startService(intent);
	}
}
